package com.css.crm.service;

import java.util.List;

import com.css.crm.exception.SystemException;
import com.css.crm.vo.DiscountCodeVo;
import com.css.crm.vo.DepartmentVo;
import com.css.crm.vo.PlaceVo;
import com.css.crm.vo.StaticReferenceVo;
import com.css.crm.vo.MenuMap;
import com.css.crm.vo.ObjectPermission;
import com.css.crm.vo.TitleVo;
import com.css.crm.vo.SystemMenu;
import com.css.crm.vo.User;

/**
 * Implementation class for SystemService
 */
/*
 * Log Date Name Description 0024746 2012 DEC 13 lawrence.ng.c.k Creation
 */
public interface SystemService extends BaseService {

	public List<SystemMenu> getApplTopMenu() throws SystemException;

	public MenuMap getCrmMenuMap() throws SystemException;

	/**
	 * Return all available users by ldapId and applId
	 * 
	 * @param ldapId
	 *            - String
	 * @param applId
	 *            - application id
	 * @return list of available users
	 * @throws SystemException
	 */
	/*
	 * Log Date Name Description 0024746 2012 DEC 13 lawrence.ng.c.k Creation
	 */
	@SuppressWarnings("unchecked")
	public List<User> getApplAccount(String ldapId, String applId) throws SystemException;

	/**
	 * Return all objects permissions by account id and application id
	 * 
	 * @param accountId
	 *            - account id
	 * @param applId
	 *            - application id
	 * @return list of AbstractObjectPermission
	 * @throws SystemException
	 */
	/*
	 * Log Date Name Description 0024746 2012 DEC 13 lawrence.ng.c.k Creation
	 */

	@SuppressWarnings("unchecked")
	public List<ObjectPermission> getAllObjectPermission(String accountId, String applId) throws SystemException;

	/**
	 * Return array of String that represents accessible account unit code
	 * 
	 * @param accountId
	 *            - account id
	 * @param applId
	 *            - application id
	 * @return array of String that represents accessible account unit code,
	 *         null for no suitable unit code
	 * @throws SystemException
	 */
	/*
	 * Log Date Name Description 0024746 2012 DEC 13 lawrence.ng.c.k Creation
	 */
	public String[] getAccountUnits(String accountId, String applId) throws SystemException;

	/**
	 * Return String that represents default unit code
	 * 
	 * @param accountId
	 *            - account id
	 * @param applId
	 *            - application id
	 * @return String that represents default unit code
	 * @throws SystemException
	 */
	/*
	 * Log Date Name Description 0024746 2012 DEC 13 lawrence.ng.c.k Creation
	 */
	public String getAccountDefaultUnit(String accountId, String applId) throws SystemException;

	/**
	 * Return String that represents single unit code
	 * 
	 * @param accountId
	 *            - account id
	 * @param applId
	 *            - application id
	 * @return String that represents single unit code (if and only if user get
	 *         one unit code)
	 * @throws SystemException
	 */
	/*
	 * Log Date Name Description 0024746 2012 DEC 13 lawrence.ng.c.k Creation
	 */
	public String getAccountSingleUnit(String accountId, String applId) throws SystemException;

	/**
	 * get original country code by department code of user
	 * 
	 * @param deptCde
	 * @return
	 */
	public Long getOrigCtryCode(String deptCde) throws SystemException;

	/**
	 * 
	 * get Country OR Province OR City List
	 * 
	 **/
	List<PlaceVo> loadPlace() throws SystemException;

	/**
	 * 
	 * get Im Statc Ref List
	 * 
	 **/
	List<StaticReferenceVo> loadStaticReference(StaticReferenceVo staticReference) throws SystemException;

	/**
	 * 
	 * get Title List
	 * 
	 **/
	List<TitleVo> loadTitle(TitleVo title) throws SystemException;

	/**
	 * 
	 * get Discount Code List
	 * 
	 **/
	List<DiscountCodeVo> loadPsDisc(DiscountCodeVo discountCode) throws SystemException;

	/**
	 * get department code List
	 * 
	 * @return
	 * @throws SystemException
	 */
	public List<DepartmentVo> loadDepartment() throws SystemException;

	/**
	 * Return sm user id by ldap user id
	 * 
	 * @param ldapUserId
	 * @param userUnitCde
	 * @return
	 * @throws SystemException
	 */
	String getUserIdByLdapId(String ldapUserId, String userUnitCde) throws SystemException;
}
